parent class 

package phonepackage;

public class Phone {

	int numbers;
	
		void dail (int n) {
			System.out.println("Dailing Number");
		}

		
		
		void receive(){
			System.out.println("Receiving Number");
		}

}



child class 


package phonepackage;

public class Iphone extends Phone {       //child class extends from parent class (phone class)
       String OS;
       
public static void main(String[] args) {
		
Iphone i = new Iphone();   // declaring variable in child class
  
i.numbers= 12345;      // child class calling calling parent and we assign the number
System.out.println(i.numbers);  //Directly call this if we gave value already parent.
i.receive();


	}

}
